<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
		$('#chrcount').keyup(function(){
			var len = $('#chrcount').val();
			var char = len.length;	
			if(254-char == 0){
				}
			$('#chrcountlength').html(255-char);	
		});
	});
	
	$(document).ready(function(){
		$('#chrcount2').keyup(function(){
			var len = $('#chrcount2').val();
			var char = len.length;	
			if(254-char == 0){
				}
			$('#chrcountlength2').html(255-char);	
		});
	});
</script>
<div id="mws-container" class="clearfix">
<div class="container">
  <div class="mws-panel grid_8">
    <div class="mws-panel-header"> 
    <span class="mws-i-24 i-list">
      <?php 
	  if(isset($details['Department']['id']) and ($details['Department']['id']))
		  { 
			echo "Edit";
		  }
	  else {
	  ?>
          Add
      <?php
	  	   }
     ?>
      Styles</span> </div>
    <div class="mws-panel-body">
      <div class="mws-form-inline"> 
	  <?php echo $form->create(array('controller'=>'setups','action'=>'','method'=>'post','enctype'=>'multipart/form-data','class' => 'mws-form')); ?> 
	  <?php 
	    if(isset($details['Department']['id'])){$details['Department']['id']=$details['Department']['id'];}
		else{$details['Department']['id']="";}
		  echo $this->Form->input('Department.id', array('type' => 'hidden','value'=>$details['Department']['id']));?>
        <div class="mws-form-row">
          <label>* Style Title :</label>
          <div class="mws-form-item small"> 
<?php 
	if(isset($details['Department']['name'])){$details['Department']['name']=$details['Department']['name'];}else{$details['Department']['name']="";}
	echo $this->Form->input('Department.name', array('type' => 'text','value'=>$details['Department']['name'],'class'=>'mws-textinput','label' =>false));?> 
  </div>
        </div>
        
        <div class="mws-form-row">
          <label>Style Category :</label>
          <div class="mws-form-item small"> 
		  <?php 
		  if(isset($details['Department']['cat_id']))
			  {
				  $exp_cat  =explode(', ',$details['Department']['cat_id']);
			  
			  }
		  else
			{
			  $details['Department']['cat_id']="";
			}
			  if(isset($exp_cat) and ($exp_cat))
				  {
					  $exp_cat = $exp_cat;
				  }
			  else
				  {
					  $exp_cat = "0";
				  }
		  echo $this->Form->input('Department.cat_id', 
                                        array('type' => 'select','options'=>$_list_categories,
                                        'default'=>$exp_cat,
										'class'=>'mws-textinput','multiple'=>'multiple','empty'=>false,'label' =>false));?> </div>
        </div>
        <div class="mws-form-row">
          <label>Status:</label>
          <div class="mws-form-item small">
		<?php 
          if(isset($details['Department']['status'])){$details['Department']['status']=$details['Department']['status'];}else{$details['Department']['status']="";}
            $options = array('1'=>'Active', '0'=>'Deactive'); 
            echo $this->Form->input('Department.status', 
            array('type' => 'select','options'=>$options,
            'default'=>$details['Department']['status'],'class'=>'mws-textinput','empty'=>false,'label' =>false)
            );
        ?>
          </div>
        </div>
        <div class="mws-form-row">
          <label>
                  <p id="chrcountlength2"></p>
          </label>
        </div>
        <div class="mws-button-row">
          <input type="submit" class="mws-button black" value="Submit">
        </div>
        </form>
      </div>
    </div>
  </div>
</div>
